package TrainingPlan;

import java.util.List;
import java.util.Vector;

import Dao.TrainingplanOperate;

public abstract class TrainingPlanDTO<Trainingplan, TrainingPlan> implements List<TrainingPlanDTO> {
	private String id;
	private String name;
	private String planyear;
	private String startdate;
	private String enddate;
	private String majorplane;
	public TrainingPlanDTO(){
		
	}
	public TrainingPlanDTO(String id,String name,String planyear,String startdate,String enddate,String majorplane){
		super();
		this.id=id;
		this.planyear=planyear;
		this.startdate=startdate;
		this.enddate=enddate;
		this.majorplane=majorplane;
		
	}
	public  String getId() {
		return id;
	}
	public  void setId(String id) {
		this.id =id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getStartdate() {
		return startdate;
	}
	public void setStartdate(String startdate) {
		this.startdate = startdate;
	}
	public String getPlanyear() {
		return planyear;
	}
	public void setPlanyear(String planyear) {
		this.planyear = planyear;
	}
	public String getEnddate() {
		return enddate;
	}
	public void setEnddate(String enddate) {
		this.enddate = enddate;
	}
	public String getMajorplane() {
		return majorplane;
	}
	public void setMajorplane(String majorplane) {
		this.majorplane = majorplane;
	}
	
	/*public static List<TrainingPlanDTO> getallPlans(){
		List<TrainingPlanDTO> allPlan=TrainingplanOperate.getAllPlan();
		TrainingPlanDTO.list2vector(allPlan);
		return null;
	}*/
	public static Vector<Vector<Object>> list2vector(List<TrainingPlanDTO> allPlan){
		
		Vector<Vector<Object>> result=new Vector<Vector<Object>>();
		for(TrainingPlanDTO p:allPlan){
			Vector<Object> v=new Vector<Object>();
			v.add(p.getId());
			v.add(p.getName());
			v.add(p.getPlanyear());
			v.add(p.getStartdate());
			v.add(p.getEnddate());
			v.add(p.getMajorplane());
			
			result.add(v);
		}
		return result;
	}
}
